<?php
//金币流水
class Controller_Admin_UserV2CoinHistory extends Controller_Form
{
    public function __construct ($req, $res)
    {
        $this->_form_type = 'userCoinHistory';
        $this->_list_pagesize = 10;
        $this->_no_buttons = TRUE;
        $this->_no_list_actions = TRUE;
        parent::__construct($req, $res);

        $this->_list_where = array(
        );

        $this->_sort_extra_columns = array(
        );
    }

    // 金币流水
    public function action_list ($page = 1)
    {
        $uid = Arr::get($this->request->query(), 'uid');
        if ($uid <= 0)
            exit;

        $this->_list_where = array(
            array('uid', '=', $uid),
        );

        parent::action_list($page);
    }

	//重构金币信息
    public function list_filter_data (& $rows)
    {
        foreach ($rows as & $rs)
        {
            if ($rs['countsCoin'] > 0)
                $rs['countsCoin'] = '+' . '￥'.number_format($rs['countsCoin']/100, 2);
            else
                $rs['countsCoin'] = '-' . '￥'.number_format(0-$rs['countsCoin']/100, 2);
        }
    }
}
